home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_bas
/
arrays
/
three-d.bas
< prev
next >
Wrap
BASIC Source File
|
1987-09-16
|
9KB
|
261 lines
defint a-z
dim cities$(100), temps(100,3,6), days$(6)
' **** here are the days of the week
days$(0)="SUNDAY" :days$(1)="MONDAY" :days$(2)="TUESDAY"
days$(3)="WEDNESDAY" :days$(4)="THURSDAY" :days$(5)="FRIDAY"
days$(6)="SATURDAY"
esc$=chr$(27)
pgup$=chr$(0)+chr$(73)
pgdn$=chr$(0)+chr$(81)
'*** Main program is here
gosub readindata
day = 0 'start with Sunday
newday.flg=-1
do
if newday.flg then
cls
gosub printoutdata
color 13
print "Press: <PgUp>-previous day, <PgDn>-next day, <Esc>-quit";
color 11
print " DAY = ";days$(day);
newday.flg=0
end if
gosub getakey
if inchar$=pgup$ then
day=day-1
newday.flg=-1
elseif inchar$=pgdn$ then
day=day+1
newday.flg=-1
elseif inchar$<>esc$ then
beep
end if
if day<0 then day=6 else if day>6 then day=0
loop until inchar$=esc$
end
'************
'GETAKEY
getakey:
do
inchar$=inkey$
loop until inchar$<>""
return
'****************************************************************************
' READINDATA - gets in the necessary data (ie, name/temperature pairs)
readindata:
restore info
read n.cities
for city=1 to n.cities
read cities$(city)
next
for day=0 to 6
for city=1 to n.cities
read temps(city,0,day), temps(city,1,day), _
temps(city,2,day), temps(city,3,day)
next
next
return
'****************************************************************************
'****************************************************************************
' PRINTOUTDATA
printoutdata:
locate 1,1
color 14
print "CITY","HIGH","LOW","PREC(mm)","WIND(mph)"
color 7
for city=1 to n.cities
print cities$(city),
print temps(city,0,day), _
temps(city,1,day), _
temps(city,2,day), _
temps(city,3,day)
next
return
'****************************************************************************
info:
data 22
data Acapulco, Athens, Beijing, Bonn
data Cairo, Copenhagen, Dublin, Geneva
data Helsinki, Jerusalem, Lima, Madrid
data Merida, Monterrey, Moscow, Nice
data Paris, Rome, Singapore, Taipei
data Toronto, Vienna
'*** Sunday info
data 96, 79, 13, 4
data 91, 68, 13, 10
data 85, 70, 8, 14
data 70, 68, 4, 13
data 92, 70, 14, 3
data 66, 47, 9, 22
data 65, 65, 7, 20
data 90, 61, 8, 17
data 62, 45, 9, 14
data 92, 63, 15, 4
data 68, 65, 15, 7
data 98, 65, 14, 4
data 88, 77, 14, 6
data 97, 77, 14, 8
data 54, 48, 4, 24
data 82, 70, 14, 9
data 72, 66, 10, 16
data 86, 66, 12, 12
data 87, 75, 11, 11
data 86, 75, 9, 14
data 74, 52, 2, 28
data 92, 59, 4, 22
'*** Monday info
data 98, 81, 15, 6
data 93, 70, 15, 12
data 87, 72, 10, 16
data 72, 70, 6, 15
data 94, 72, 16, 5
data 68, 49, 11, 24
data 67, 67, 9, 22
data 92, 63, 10, 19
data 64, 47, 11, 16
data 94, 65, 17, 6
data 70, 67, 17, 9
data 100, 67, 16, 6
data 90, 79, 16, 8
data 99, 79, 16, 10
data 56, 50, 6, 26
data 84, 72, 16, 11
data 74, 68, 12, 18
data 88, 68, 14, 14
data 89, 77, 13, 13
data 88, 77, 11, 16
data 76, 54, 4, 30
data 94, 61, 6, 24
'*** Tuesday info
data 100, 83, 17, 8
data 95, 72, 17, 14
data 89, 74, 12, 18
data 74, 72, 8, 17
data 96, 74, 18, 7
data 70, 51, 13, 26
data 69, 69, 11, 24
data 94, 65, 12, 21
data 66, 49, 13, 18
data 96, 67, 19, 8
data 72, 69, 19, 11
data 102, 69, 18, 8
data 92, 81, 18, 10
data 101, 81, 18, 12
data 58, 52, 8, 28
data 86, 74, 18, 13
data 76, 70, 14, 20
data 90, 70, 16, 16
data 91, 79, 15, 15
data 90, 79, 13, 18
data 78, 56, 6, 32
data 96, 63, 8, 26
'*** Wednesday info
data 102, 85, 19, 10
data 97, 74, 19, 16
data 91, 76, 14, 20
data 76, 74, 10, 19
data 98, 76, 20, 9
data 72, 53, 15, 28
data 71, 71, 13, 26
data 96, 67, 14, 23
data 68, 51, 15, 20
data 98, 69, 21, 10
data 74, 71, 21, 13
data 104, 71, 20, 10
data 94, 83, 20, 12
data 103, 83, 20, 14
data 60, 54, 10, 30
data 88, 76, 20, 15
data 78, 72, 16, 22
data 92, 72, 18, 18
data 93, 81, 17, 17
data 92, 81, 15, 20
data 80, 58, 8, 34
data 98, 65, 10, 28
'*** Thursday info
data 104, 87, 21, 12
data 99, 76, 21, 18
data 93, 78, 16, 22
data 78, 76, 12, 21
data 100, 78, 22, 11
data 74, 55, 17, 30
data 73, 73, 15, 28
data 98, 69, 16, 25
data 70, 53, 17, 22
data 100, 71, 23, 12
data 76, 73, 23, 15
data 106, 73, 22, 12
data 96, 85, 22, 14
data 105, 85, 22, 16
data 62, 56, 12, 32
data 90, 78, 22, 17
data 80, 74, 18, 24
data 94, 74, 20, 20
data 95, 83, 19, 19
data 94, 83, 17, 22
data 82, 60, 10, 36
data 100, 67, 12, 30
'*** Friday info
data 106, 89, 23, 14
data 101, 78, 23, 20
data 95, 80, 18, 24
data 80, 78, 14, 23
data 102, 80, 24, 13
data 76, 57, 19, 32
data 75, 75, 17, 30
data 100, 71, 18, 27
data 72, 55, 19, 24
data 102, 73, 25, 14
data 78, 75, 25, 17
data 108, 75, 24, 14
data 98, 87, 24, 16
data 107, 87, 24, 18
data 64, 58, 14, 34
data 92, 80, 24, 19
data 82, 76, 20, 26
data 96, 76, 22, 22
data 97, 85, 21, 21
data 96, 85, 19, 24
data 84, 62, 12, 38
data 102, 69, 14, 32
'*** Saturday info
data 108, 91, 25, 16
data 103, 80, 25, 22
data 97, 82, 20, 26
data 82, 80, 16, 25
data 104, 82, 26, 15
data 78, 59, 21, 34
data 77, 77, 19, 32
data 102, 73, 20, 29
data 74, 57, 21, 26
data 104, 75, 27, 16
data 80, 77, 27, 19
data 110, 77, 26, 16
data 100, 89, 26, 18
data 109, 89, 26, 20
data 66, 60, 16, 36
data 94, 82, 26, 21
data 84, 78, 22, 28
data 98, 78, 24, 24
data 99, 87, 23, 23
data 98, 87, 21, 26
data 86, 64, 14, 40
data 104, 71, 16, 34